package com.systec.smalltools.util;

import com.systec.smalltools.vo.ResultVO;

/**
 * @author cmd
 */
public class ResultVOUtils {
    public static ResultVO success(Object data) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMessage("解析成功！");
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO error(String error) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMessage(error);
        resultVO.setData(null);
        return resultVO;
    }

    public static ResultVO error(String error, Object data) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMessage(error);
        resultVO.setData(data);
        return resultVO;
    }

}
